package com.gyms.manager;

import android.content.Context;
import android.support.v4.app.FragmentManager;

import weight.ComDialog;

/**
 * Created by ltx on 17/6/2
 * dialogUtils
 */

public class CommonDialogUtils {
    /**
     *
     * @param mContext 上下文
     * @param mFragmentManager mFragmentManager
     * @param mContent 内容
     * @return ComDialog
     */
    public static ComDialog dialog(Context mContext,FragmentManager mFragmentManager,String mContent) {
        ComDialog dialog = ComDialog.newInstance(mContext);
        dialog.setTitle("温馨提示");
        dialog.setText(mContent);
        dialog.show(mFragmentManager, "ComDialog");
        return dialog;
    }

    /**
     *
     * @param mContext mContext
     * @param mFragmentManager mFragmentManager
     * @param mTitle 标题
     * @param mContent 内容
     * @return ComDialog
     */

    public static ComDialog dialog(Context mContext,FragmentManager mFragmentManager,String mTitle,String mContent) {
        ComDialog dialog = ComDialog.newInstance(mContext);
        dialog.setTitle(mTitle);
        dialog.setText(mContent);
        dialog.show(mFragmentManager, "ComDialog");
        return dialog;
    }

    /**
     *
     * @param mContext mContext
     * @param mFragmentManager mFragmentManager
     * @param mTitle 标题
     * @param mContent mContent
     * @param mSubmitText 确定文本
     * @param mCancelText 取消文本
     * @return ComDialog
     */

    public static ComDialog dialog(Context mContext,FragmentManager mFragmentManager,String mTitle,String mContent,String mSubmitText,String mCancelText) {
        ComDialog dialog = ComDialog.newInstance(mContext);
        dialog.setTitle(mTitle);
        dialog.setText(mContent);
        dialog.setSubmitText(mSubmitText);
        dialog.setCancelText(mCancelText);
        dialog.show(mFragmentManager, "ComDialog");
        return dialog;
    }

    /**
     *
     * @param mContext mContext
     * @param mFragmentManager mFragmentManager
     * @param mTitle 标题
     * @param mContent  内容
     * @param mSubmitText 提交文本
     * @param mCancelText 取消文本
     * @param isRightSubmit 是否是右侧确定
     * @return ComDialog
     */

    public static ComDialog dialog(Context mContext,FragmentManager mFragmentManager,String mTitle,String mContent,String mSubmitText,String mCancelText,boolean isRightSubmit) {
        ComDialog dialog = ComDialog.newInstance(mContext);
        dialog.setTitle(mTitle);
        dialog.setText(mContent);
        if(!isRightSubmit){
            dialog.setLeftSubmit(mContext);
        }
        dialog.setCancelText(mCancelText);
        dialog.setSubmitText(mSubmitText);
        dialog.show(mFragmentManager, "ComDialog");
        return dialog;
    }


}
